package service;


import java.util.LinkedList;
import java.util.List;


import util.RegexUtil;

import dao.CommentDAO;
import domain.Actor;
import domain.Comment;
import ex.DatabaseException;
import ex.ProjectCompositionFailedException;
import ex.RegistrationFailedException;

public class CommentService {

	CommentDAO commentDao=new CommentDAO();
	
	public LinkedList<Comment> getCommentsByMid(long mid) throws DatabaseException
	{
		return commentDao.selectCommentsByMid(mid);
	}
	public LinkedList<Comment> getCommentsByUidR(long uidR) throws DatabaseException
	{
		return commentDao.selectCommentsByUidR(uidR);
	}
	public void createComment(Comment comment) throws DatabaseException, ProjectCompositionFailedException
	{
		commentDao.insertComment(comment);
	}
	public void deleteComment(Comment comment) throws DatabaseException{
		if(comment!=null){
			commentDao.deleteComment(comment);
		}
	}
	public void updateComment(Comment comment) throws DatabaseException{
		if(comment!=null){
			commentDao.updateComment(comment);
		}
	}
	public void incrementCommentFlag(Comment comment) throws DatabaseException{
		if(comment!=null){
			commentDao.incrementCommentFlag(comment);
		}
	}
}
